import {
  getSystemBtnsList,
} from '@/api/permissions'

export const getQueryString = name => {
  var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
  const r = (window.location.href.indexOf('?') > -1) && window.location.href.split('?')[1].match(reg);
  if (r) {
    return unescape(r[2]);
  }
  return null;
}
/* 获取平台的全量菜单 */
export const getAllBtnsList = async () => {
  let res = await getSystemBtnsList({}, 11)
  if (res.code == 0 && res.data) {
    sessionStorage.setItem('systemBtnsList', JSON.stringify(res.data))
  } else {
    this.$Message.error(res.msg)
  }
  return res.data
}
